﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Dao;
using Y2.Filters;

namespace Y2.Controllers
{
    [Obsolete]
    [LoginFilter]
    public class config_major_kindController : Controller
    {
        private readonly Iconfig_major_kind he;

        public config_major_kindController(Iconfig_major_kind he)
        {
            this.he = he;
        }

        public IActionResult config_major_kind()
        {
            return View();
        }
        
        public async Task<IActionResult> Index7(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Index7(currentPage, pageSize)));
        }

        public async Task<int> Inser4(string major_kind_id, string major_kind_name)
        {
            return await he.Inser4(major_kind_id, major_kind_name);
        }

        public async Task<string> Cz()
        {
            return await he.Cz();
        }

        public async Task<int> delt4(int mfk_id)
        {
            return await he.delt4(mfk_id);
        }
    }
}
